<% add_decidim_page_title(t("titles.panel", scope: "decidim.admin")) %>
<% add_decidim_page_title(current_organization_name) %>
<!doctype html>
<html class="no-js" lang="<%= I18n.locale %>" dir="<%= rtl_direction %>">
  <head>
    <%= tag :meta, charset: "utf-8" %>
    <%= tag :meta, content: "IE=edge,chrome=1", "http-equiv": "X-UA-Compatible" %>
    <%= tag :meta, name: "viewport", content: "width=device-width, initial-scale=1.0" %>
    <title><%= decidim_page_title %></title>
    <%= render partial: "layouts/decidim/admin/header" %>
  </head>
  <body>

    <main class="main">
      <div class="layout-wrapper">
        <div class="block md:hidden col-start-1 col-end-2">
          <%= render partial: "layouts/decidim/admin/title_bar_responsive" %>
        </div>
        <div class="relative md:flex grow min-h-max w-full">
          <div class="layout-nav">
            <%= link_to decidim_admin.root_path, class: "logo hidden md:block", data: { "external-link": false }, aria: { label: t("decidim.accessibility.logo", organization: current_organization_name) } do %>
              <% if current_organization.logo.present? %>
                <%= image_tag current_organization.attached_uploader(:logo).url, alt: current_organization_name %>
              <% else %>
                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 134 109">
                  <g fill="#fff">
                  <path d="M0 44.664a18.345 18.345 0 0 1 1.44-7.14 18.633 18.633 0 0 1 4.116-6.053 19.014 19.014 0 0 1 6.165-4.048A19.326 19.326 0 0 1 18.997 26h15.205a3.842 3.842 0 0 1 2.684 1.093A3.696 3.696 0 0 1 38 29.726v74.548c0 .489-.098.973-.29 1.426-.19.452-.47.863-.822 1.208A3.856 3.856 0 0 1 34.202 108H18.997c-5.037-.002-9.867-1.965-13.429-5.458C2.006 99.048.003 94.312 0 89.37V44.664ZM80.202 0H49.798C47.7 0 46 1.684 46 3.76v101.48c0 2.076 1.7 3.76 3.798 3.76h30.404c2.097 0 3.798-1.684 3.798-3.76V3.76C84 1.683 82.3 0 80.202 0ZM134 89.506a18.157 18.157 0 0 1-3.205 10.276 18.896 18.896 0 0 1-8.528 6.811 19.477 19.477 0 0 1-10.978 1.05 19.165 19.165 0 0 1-9.726-5.064 18.352 18.352 0 0 1-5.198-9.472 18.043 18.043 0 0 1 1.082-10.688 18.614 18.614 0 0 1 6.998-8.302A19.363 19.363 0 0 1 115 71c5.04.002 9.873 1.952 13.435 5.422C132 79.892 134 84.599 134 89.506Z" />
                  </g>
                </svg>
              <% end %>
            <% end %>
            <%= main_menu_modules.render %>
            <%= main_menu.render %>
          </div>
          <div class="layout-content">
            <div class="hidden md:block">
              <%= render partial: "layouts/decidim/admin/title_bar" %>
            </div>
            <%= yield :secondary_nav if content_for? :secondary_nav %>
            <%= yield :sidebar_menu_nav if content_for? :sidebar_menu_nav %>
            <%= yield :aside_menu_nav if content_for? :aside_menu_nav %>

            <%= render partial: "layouts/decidim/admin/breadcrumb" %>
            <%= render partial: "layouts/decidim/admin/callouts_full" %>

            <% if has_secondary_root_menu? %>
              <div class="layout-content__container-sidebar" data-content>
                <%= render "layouts/decidim/admin/sidebar_menu" do %>
                  <%= yield %>
                <% end %>
              </div>
            <% else %>
              <div class="layout-content__container" data-content>
                <%= admin_tabs(tab_menu_name).render if defined?(has_tab_menu?) && has_tab_menu? %>
                <%= yield %>
              </div>
            <% end %>
          </div>
        </div>
      </div>
    </main>

    <%= render partial: "layouts/decidim/timeout_modal" %>
    <%= render partial: "decidim/shared/confirm_modal" %>
    <%= render partial: "layouts/decidim/admin/js_configuration" %>
    <%= render partial: "layouts/decidim/cors" if Decidim.cors_enabled %>

    <%= snippets.display(:foot) %>
  </body>
</html>
